package com.hmall.common.client;

import com.hmall.common.config.DefaultFeignConfiguration;
import com.hmall.common.pojo.Address;
import com.hmall.common.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

//Feign客户端配置
@FeignClient(value = "userservice", configuration = DefaultFeignConfiguration.class)
public interface UserClient {
    @GetMapping("/address/{addressId}")
    Address queryAddress(@PathVariable("addressId") Long id);

    @GetMapping("/user/findUser/{userId}")
    User findUser(@PathVariable("userId") Long userId);

    @PutMapping("pay/{userId}/{num}")
    Boolean UserPay(@PathVariable("userId") Long userId, @PathVariable("num") Long num);

    @GetMapping("/query/balance/{userId}")
    Long queryBalance(@PathVariable("userId") Long userId);
}
